﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Admin_VacancyDetails : System.Web.UI.Page
{
    string VacancyID = "";
    AddminMethord AM = new AddminMethord();
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            VacancyID = Request.QueryString["ID"].ToString();
            LoadData();
        }
        catch (Exception ex)
        {
        }
    }
    public void LoadData()
    {
        try
        {
            DataTable tb = AM.LoadInformationVacancyFollowID(VacancyID);
            if (tb.Rows.Count > 0)
            {
                txtVacancyID.Text = tb.Rows[0]["VacancyID"].ToString();
                txtTitle.Text = tb.Rows[0]["Title"].ToString();
                txtEmployee.Text = "<a href='AdminViewEmployeeInfor.aspx?ID=" + tb.Rows[0]["UserName"].ToString() + "'>" + AM.ReturnEmployeeName(tb.Rows[0]["UserName"].ToString()) + "</a>";
                txtDescription.Text = tb.Rows[0]["Description"].ToString();
                txtNumberOfJob.Text = tb.Rows[0]["NumberOfJob"].ToString();
                txtNumberEmpty.Text = tb.Rows[0]["NumberEmpty"].ToString();
                txtSalary.Text = tb.Rows[0]["Salary"].ToString();
                txtWorkplace.Text = tb.Rows[0]["Workplace"].ToString();
                txtDateCreatioin.Text = tb.Rows[0]["DateCreatioin"].ToString().Substring(0, tb.Rows[0]["DateCreatioin"].ToString().IndexOf(" "));
                txtDateFulfilled.Text = tb.Rows[0]["DateFulfilled"].ToString().Substring(0, tb.Rows[0]["DateFulfilled"].ToString().IndexOf(" "));
                switch (tb.Rows[0]["Status"].ToString())
                {
                    case "1":
                        txtStatus.Text = "On";
                        break;
                    case "2":
                        txtStatus.Text = "Suspended";
                        break;
                    case "3":
                        txtStatus.Text = "Close";
                        break;
                }
            
            }
        }
        catch (Exception ex)
        {
        }
    }
}